package com.sskj.aikeeper.login;

import android.util.Log;

import com.lzy.okgo.model.Response;
import com.sskj.aikeeper.presenter.BasePresenter;
import com.sskj.common.base.HttpData;
import com.sskj.common.util.MD5Util;
import com.sskj.lib.bean.HeaderBean;
import com.sskj.lib.http.JsonCallBack;


/**
 * @author Hey
 * Create at  2019/06/25
 */

class LoginPresenter extends BasePresenter<LoginActivity> {
    public void login(String name, String pwd) {

        httpService.login(name, MD5Util.getFiveMd5Value(pwd))
                .tag(this)
                .execute(new JsonCallBack<HttpData<HeaderBean>>(this) {
                    @Override
                    public void onSuccess(Response<HttpData<HeaderBean>> response) {

                        mView.login(response.body().getData());
                    }
                });
    }
}
